import Vuex from "vuex";
import VuexPersistence from "vuex-persist";
import menus from "./module/menus";
import userInfo from "./module/userInfo";
import config from "./module/config";
export default new Vuex.Store({
  state: {
    //
  },
  getters: {
    //
  },
  mutations: {
    //
  },
  actions: {
    //
  },
  plugins: [
    new VuexPersistence({
      reducer: state => ({
        menus: state.menus, // 这个就是存入localStorage的值
        userInfo: state.userInfo,
        config: state.config
      }),
      storage: window.localStorage
    }).plugin
  ],
  modules: {
    menus,
    userInfo,
    config
  }
});
